﻿<Window x:Class="Hockey.UILayer.Forms.NewGameForm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"                                                                                        
        Title="{loc:Translate Default='Nová hra'}" WindowStyle="ToolWindow" ShowInTaskbar="False" SizeToContent="WidthAndHeight" ResizeMode="NoResize"
        xmlns:service="clr-namespace:MVVMDialogs;assembly=MVVMDialog"              
        service:DialogService.IsRegisteredView="True"     
        WindowStartupLocation="CenterOwner"
        
        Background="{DynamicResource WindowBackgroundBrush}" >
    <Window.Resources>
        <Style x:Key="uxButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
            <Setter Property="Margin" Value="10" />
            <Setter Property="Padding" Value="8" />
        </Style>
        <Style x:Key="uxGroupBoxStyle" TargetType="{x:Type GroupBox}" BasedOn="{StaticResource {x:Type GroupBox}}">
            <Setter Property="Margin" Value="10" />
            <Setter Property="Padding" Value="5" />
        </Style>
        <Style x:Key="uxRadioStyle" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Type RadioButton}}">
            <Setter Property="Margin" Value="5" />
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <GroupBox Header="{loc:Translate Default='Počet hráčů'}" Style="{StaticResource uxGroupBoxStyle}" Grid.Column="0">
                <StackPanel Orientation="Vertical">
                    <RadioButton GroupName="NumPlayers" Content="{loc:Translate Default='Hra s počítačem'}" Style="{StaticResource uxRadioStyle}" 
                                 IsChecked="{Binding Path=IsComputerGame, Mode=TwoWay}"/>
                    <RadioButton GroupName="NumPlayers" Content="{loc:Translate Default='Hra dvou hráčů'}" Style="{StaticResource uxRadioStyle}" />
                </StackPanel>
            </GroupBox>

            <GroupBox Header="{loc:Translate Default='Obtížnost počítače'}" Style="{StaticResource uxGroupBoxStyle}" Grid.Column="1" IsEnabled="{Binding Path=IsComputerGame}">
                <StackPanel Orientation="Vertical">
                    <RadioButton GroupName="Level" Content="{loc:Translate Default='Začátečník'}" Style="{StaticResource uxRadioStyle}" 
                                 IsChecked="{Binding Path=IsNoviceLevel, Mode=TwoWay}" />
                    <RadioButton GroupName="Level" Content="{loc:Translate Default='Pokročilý'}" Style="{StaticResource uxRadioStyle}" />
                </StackPanel>
            </GroupBox>

            <GroupBox Header="{loc:Translate Default='První na tahu'}" Style="{StaticResource uxGroupBoxStyle}" Grid.Column="2" IsEnabled="{Binding Path=IsComputerGame}">
                <StackPanel Orientation="Vertical">
                    <RadioButton GroupName="FirstToMove" Content="{loc:Translate Default='Počítač na tahu první'}" Style="{StaticResource uxRadioStyle}" 
                                 IsChecked="{Binding Path=EngineFirstToMove, Mode=TwoWay}" />
                    <RadioButton GroupName="FirstToMove" Content="{loc:Translate Default='Hráč na tahu první'}" Style="{StaticResource uxRadioStyle}"
                                 IsChecked="{Binding Path=PlayerFirstToMove}"/>
                </StackPanel>
            </GroupBox>
        </Grid>
        
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
            <Button Content="{loc:Translate Default='Začít novou hru'}" Style="{StaticResource uxButtonStyle}"
                    Command="{Binding Path=StartNewGameCommand}" />
            <Button Content="{loc:Translate Default='Storno'}" Style="{StaticResource uxButtonStyle}"
                    Command="{Binding Path=CancelFormCommand}"    />
        </StackPanel>


    </Grid>
</Window>
